<template>
	<view class="evaluate">
		<div class="time_con" v-for="item in list" :key="item.id">
			<div class="left">
				<img src="../static/my/userH.png" alt="" class="img" @click="goMy(item)" />
			</div>
			<div class="con">
				<p class="p1">
					{{item.name}}
					<view class="mm">
						
					</view>
				</p>
				<p class="p2">
					销售经理
				</p>
				
			</div>
			<div class="right">
				<p class="p11">查看次数：10次</p>
				<p class="p11">最后查看：10分钟前</p>
			</div>
		</div>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue'
	const list = ref([])
	let randomTime = []

	onMounted(() => {
		getData()
	})
	const getData = () => {
		wx.request({
			url: 'http://localhost:3000/getData',
			method: 'POST',
			data: {
				// 请求参数
			},
			header: {
				// 请求头
				'content-type': 'application/json'
			},
			success: function(res) {
				const {
					data
				} = res.data
				console.log('请求成功', data);
				list.value = data
				getTime()

			},
			fail: function(err) {
				console.log('请求失败', err);
				// 处理请求失败
			}
		});
	}
	const getTime = () => {
		for (let i = 0; i < list.value.length; i++) {
			const randomDate = new Date(Math.random() * Date.now());
			randomTime.push(randomDate.toLocaleTimeString())
		}
		console.log(randomTime)
	}
	const goMy = (item)=>{
		uni.navigateTo({
			url:`/pages/my/gerf/gerf?data=${JSON.stringify(item)}`
		})
	}
</script>

<style scoped lang="scss">
	.p2{
		color: 	#cccccc;
	}
	.evaluate {
		width: 100%;
		height: 100%;
		box-sizing: border-box;
		padding: 0px 20rpx;
		background-color: #f8f8f8;
		padding-top: 10rpx;

		.time_con {
			display: flex;
			margin-top: 20rpx;
			// padding: 20rpx 0rpx;
			// align-items: center;
			background-color: #ffffff;
			border-radius: 20rpx;
			box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
			.img{
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
			}
			.img1{
				width: 30rpx;
				height: 30rpx;
			}

			// padding: 0px ;
			.p1 {
				// margin: 15rpx 0rpx;
				padding: 20rpx 0rpx;
				margin-bottom: 15rpx;
				display: flex;

				// margin-right: 10rpx;
				.mm {
					margin-left: 10rpx;
					font-size: 20rpx;
					color: #999999;
					margin-top: 5rpx;
				}
			}

			.p3 {
				// margin-top: 20rpx;
				display: flex;
				color: #99a6c4;
				align-items: center;
			}

			.left {
				margin: 10rpx 10rpx;
				padding: 20rpx 0rpx;
				// width: 200rpx;
				// text-align: left;
				// margin-right: 200rpx;
			}
			.con{
				width: 150rpx;
			}

			.right {
				border-left: 1px solid #f2f2f2;
				color: #999999;
				padding-left: 40rpx;
				font-size: 30rpx;
				// align-items: center;
				// line-height: 30rpx;
				display: flex;
				flex-direction: column;
				// align-items: center;
				justify-content: center;
				.p11{
					margin-top: 10rpx;
				}
				
			}
		}
	}
</style>